Introducing a new PagerDuty CLI

Hi @martin @jcalcada - Just checking if you can help me to get the report with * Specific to Escalation Policy and Customized Date/time.

The basic_incident_details routine looks at incident details but unfortunately the Escalation Policy isn’t part of the payload. To get that information you’ll need to look at the service associated with the incident and then lookup the EP from there.

The routine allows you to use a customized date/time instead of the pd-cli tools easier to use syntax such as “yesterday”. You can get more details on how to customize the date here https://developer.pagerduty.com/api-reference for more details.

Thanks @jcalcada - Apologies for the wrong question asked.

Can you please add specific service ( for example - Test), what should be the code looks like.

CC - @martin

Hi @martin @jcalcada - Let me know if I need to add service into the script -

Let me what I am missing here to get the service name in the Report.


C:\Users\gargv>py C:\PD_Scripts\Incident-Notes-New3.py --services=MiCloudFlex_MiNOC --output_file C:\PD_Scripts\TestIncidentnotes4.csv --start “1 day ago”
Getting incidents
 got 116
Getting incident logs
 got 1163 log entries
Traceback (most recent call last):
File “C:\PD_Scripts\Incident-Notes-New3.py”, line 81, in
incident[‘services’],
KeyError: ‘services’

Hi @jcalcada @martin - Appreciate your help here as looking for the solution on this Pagerduty reporting

If you run a GET API call on an incident (you can use the snippet below for example output), you’ll see it contains the service name and id. You’ll need to factor that into your code and you can certainly get that information from incident details. If you need help with developing a more robust solution one option you have is to leverage our professional services organization who would be happy to create something for you for a nominal cost.

echo “enter incident id:”
read A
curl --request GET
–url “https://api.pagerduty.com/incidents/{$A}?include[]=external_references”
–header ‘Accept: application/vnd.pagerduty+json;version=2’
–header ‘Authorization: Token token=yourkey’
–header ‘Content-Type: application/json’

Hi Thanks @jcalcada - Just checking the cost for PD Professional services to create a one time solution in PD CLI for Reporting purpose.

Great. Your PagerDuty account executive can provide information on the professional services options available to you.